from machine import SPI, Pin,ADC
from UC1701 import UC1701
import utime
import zk
hspi = SPI(1, sck=Pin(9), mosi=Pin(8), miso=Pin(4))
switch=Pin(0,Pin.OUT)
switch.on()
cd = Pin(7)
rst = Pin(6)
cs = Pin(5)

display = UC1701(hspi, cd, rst, cs)
display.contrast(150)
display.text("UC1701ab12321c", 3, 3, 1)
display.show()
display.print8("absdf")
display.print16([1,2,3],0,4)
display.print32([3],2,4)
display.fill(0)
display.show()

display.print32([1,2,3,14],4,0)
pot = ADC(Pin(4))
pot.atten(ADC.ATTN_6DB)
while True:
    print(pot.read())
    display.print8(f"{pot.read():d}")
    utime.sleep_ms(100)